<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
      <!-- <el-form-item prop="deptId">
        <treeselect v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="部门"
          style="width: 480px"/>
      </el-form-item> -->
      <el-form-item prop="storeId">
        <!-- <treeselect v-model="queryParams.storeId" :options="storeOptions" :show-count="true" placeholder="仓库"
          style="width: 120px"/> -->
        <el-select v-model="queryParams.storeId" placeholder="仓库" clearable size="small" style="width: 100px">
          <el-option v-for="dict in storeOptions" :key="dict.id" :label="dict.label"
                     :value="dict.id"
          />
        </el-select>
      </el-form-item>
      <el-form-item prop="type">
        <el-select v-model="queryParams.type" placeholder="订单类型" clearable size="small" style="width: 100px"
                   @change="orderTypeChange"
        >
          <el-option v-for="dict in orderTypes" :key="dict.value" :label="dict.label"
                     :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item prop="taskNo">
        <el-input v-model="queryParams.taskNo" placeholder="订单编号搜索" clearable size="small"
                  @keyup.enter.native="handleQuery" style="width: 150px"
        />
      </el-form-item>
      <el-form-item prop="proKey">
        <el-input v-model="queryParams.proKey" placeholder="物品编号/名称/特征关键字搜索" clearable size="small"
                  @keyup.enter.native="handleQuery" style="width: 220px"
        />
      </el-form-item>
      <el-form-item prop="delivery">
        <el-select v-model="queryParams.delivery" placeholder="配送方式" clearable size="small" @change="deliverChage"
                   style="width: 100px"
        >
          <el-option v-for="dict in dict.type.oms_delivery_type" :key="dict.value" :label="dict.label"
                     :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item prop="carrierDeptId" v-if="queryParams.delivery == '0'">
        <el-select v-model="queryParams.carrierDeptId" placeholder="承运商" clearable size="small">
          <el-option
            v-for="item in carrierOptions"
            :key="item.deptId"
            :label="item.carrierName"
            :value="item.deptId"
          />
        </el-select>
      </el-form-item>
      <el-form-item prop="instatus" v-if="queryParams.type == '0' || queryParams.type=='5'">
        <el-select v-model="queryParams.instatus" placeholder="入库状态" clearable size="small">
          <el-option v-for="dict in inStatuses" :key="dict.value" :label="dict.label"
                     :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item prop="outstatus" v-if="queryParams.type == '1' || queryParams.type=='2' || queryParams.type=='3'">
        <el-select v-model="queryParams.outstatus" placeholder="出库状态" clearable size="small">
          <el-option v-for="dict in outStatuses" :key="dict.value" :label="dict.label"
                     :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item prop="dealType" v-if="queryParams.type=='2'">
        <el-select v-model="queryParams.dealType" placeholder="处置类型" clearable size="small">
          <el-option v-for="dict in dealTypes" :key="dict.value" :label="dict.label"
                     :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item prop="status">
        <el-select v-model="queryParams.status" placeholder="状态" clearable size="small">
          <el-option v-for="dict in dict.type.oms_task_status" :key="dict.value" :label="dict.label"
                     :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item prop="daterangeCreateTime">
        <el-date-picker v-model="daterangeCreateTime" size="small" style="width: 220px" value-format="yyyy-MM-dd"
                        type="daterange" range-separator="-" start-placeholder="下单日期" end-placeholder="截止日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item prop="daterangeHandleTime">
        <el-date-picker v-model="daterangeHandleTime" size="small" style="width: 220px" value-format="yyyy-MM-dd"
                        type="daterange" range-separator="-" start-placeholder="签收日期" end-placeholder="截止日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
      </el-form-item>
    </el-form>
    <el-row>
      <el-col :span="8" class="mb10">
        <el-radio-group v-model="sendStatusVal" @change="radioChange" size="mini">
          <el-radio-button v-for="tab in tabs" :label="tab.label">
            <el-badge :value="tab.badge" class="item">
              {{ tab.name }}
            </el-badge>
          </el-radio-button>
        </el-radio-group>
        <el-radio-group v-model="xzTabVal" @change="xzTabChange" size="mini" style="margin-left: 30px">
          <el-radio-button v-for="tab in xzTabs" :label="tab.label">
            <el-badge :value="tab.badge" class="item">
              {{ tab.name }}
            </el-badge>
          </el-radio-button>
        </el-radio-group>
      </el-col>
      <el-col :span="16">
        <template v-for="item in statisticsOptions">
          <el-badge :value="item.totals" class="item" :is-dot="item.totals>0?false:true"
                    :type="item.totals>0?'danger':'info'" style="margin-left: 15px;"
          >
            <el-button @click="statisticsChange(item)" size="mini"
                       :type="item.region == queryParams.region ? 'primary':''"
                       :plain="item.region == queryParams.region"
            >{{ item.regionName }}
            </el-button>
          </el-badge>
        </template>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange" :default-sort="defaultSort"
              @sort-change="handleSortChange" border stripe
    >
      <el-table-column type="selection" width="55" align="center" fixed="left"/>
      <el-table-column label="订单类型" align="center" prop="taskNo" width="100" fixed="left">
        <template slot-scope="scope">
          <el-tag size="small" type="success" v-if="scope.row.taskNo.startsWith('R') && scope.row.returnId != null">归还
          </el-tag>
          <el-tag size="small" v-else-if="scope.row.taskNo.startsWith('R')">入库</el-tag>
          <el-tag size="small" type="warning" v-else-if="scope.row.taskNo.startsWith('E')">出库</el-tag>
          <el-tag size="small" type="danger" v-else-if="scope.row.taskNo.startsWith('C')">处置</el-tag>
          <el-tag size="small" type="info" v-else-if="scope.row.taskNo.startsWith('D')">调用</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="申请编号" prop="taskNo" width="160" fixed="left">
        <template slot-scope="scope">
          <el-link type="primary" @click="handleInfo(scope.row)">{{ scope.row.taskNo }}</el-link>
          <el-tooltip v-if="scope.row.source =='1' && scope.row.checkStatus =='0'" effect="dark" content="待民警确认"
                      placement="top-start"
          >
            <i class="el-icon-warning-outline" style="color:red"></i>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column label="申请部门" prop="deptName" min-width="220"/>
      <el-table-column label="姓名" prop="name" width="120"/>
      <el-table-column label="联系方式" prop="tel" width="140"/>
      <el-table-column label="物品类型" align="left" prop="propertyType" width="120">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.oms_property_type" :value="scope.row.propertyType"/>
        </template>
      </el-table-column>
      <el-table-column label="配送部门" align="left" prop="deliveryDept" width="180">
        <template slot-scope="scope">
          <span v-if="scope.row.deliveryDept">{{ scope.row.deliveryDept }}</span>
          <template v-else-if="scope.row.type=='0'">
            <dict-tag :options="dict.type.oms_in_delivery_type" :value="scope.row.delivery"/>
          </template>
          <template v-else-if="scope.row.type=='1'">
            <dict-tag :options="dict.type.oms_out_delivery_type" :value="scope.row.delivery"/>
          </template>
          <template v-else-if="scope.row.type=='2'">
            <dict-tag :options="dict.type.oms_out_delivery_type" :value="scope.row.delivery"/>
          </template>
          <template v-else-if="scope.row.type=='3'">
            <dict-tag :options="dict.type.oms_out_delivery_type" :value="scope.row.delivery"/>
          </template>
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.oms_task_status" :value="scope.row.status"/>
        </template>
      </el-table-column>
      <el-table-column label="下发状态" align="center" prop="sendStatus" v-if="!queryParams.sendStatus" width="120">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.oms_send_status" :value="scope.row.sendStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="下单时间" sortable="custom" :sort-orders="['descending', 'ascending']" align="center"
                       prop="createTime" width="180"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="签收时间" sortable="custom" :sort-orders="['descending', 'ascending']" align="center"
                       width="180" prop="handTime"
      >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.handTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
        <template slot-scope="scope">
          <el-button v-if="scope.row.delFlag == '0'" size="mini" type="text" icon="el-icon-view"
                     @click="handleInfo(scope.row)"
                     v-hasPermi="['oms:task:edit']"
          >查看
          </el-button>
          <el-button v-if="scope.row.delFlag == '0' && scope.row.status == '0'" size="mini" type="text"
                     icon="el-icon-delete" @click="handleDel(scope.row)"
                     v-hasPermi="['oms:task:edit']"
          >撤销
          </el-button>
          <el-button v-if="scope.row.delFlag == '0'" size="mini" type="text" icon="el-icon-delete"
                     @click="handleAdminDel(scope.row)"
                     v-hasPermi="['oms:task:removeByAdmin']"
          >强制撤销
          </el-button>
          <el-button v-if="scope.row.delFlag == '2'" size="mini" type="text" icon="el-icon-refresh-left"
                     @click="handleRestore(scope.row)"
                     v-hasPermi="['oms:task:edit']"
          >恢复
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                @pagination="getList"
    />
    <el-drawer :title="title" :visible.sync="open" size="75%" :before-close="close" v-if="form.type == '0'">
      <div class="mb20 ml20">
        <span style="font-size: 20px;">{{ form.taskNo }}</span>
      </div>
      <el-card>
        <el-tabs v-model="activeName">
          <el-tab-pane label="申请详情" name="1">
            <el-card>
              <el-descriptions title="基本信息" :column="4" border>
                <el-descriptions-item :label="form.delivery == '0' ? '寄件单位':'送件单位'" :span="2">{{ form.deptName }}
                </el-descriptions-item>
                <el-descriptions-item :label="form.delivery == '0' ? '寄件人':'送件人'">{{ form.name }}</el-descriptions-item>
                <el-descriptions-item label="联系电话">{{ form.tel }}</el-descriptions-item>
                <el-descriptions-item v-if="form.delivery == '0'" label="寄件地址" :span="4">{{ form.address }}
                </el-descriptions-item>
                <el-descriptions-item label="物证类型">
                  <dict-tag :options="dict.type.oms_property_type" :value="form.propertyType"/>
                </el-descriptions-item>
                <el-descriptions-item label="物流配送">
                  <dict-tag :options="dict.type.oms_in_delivery_type" :value="form.delivery"/>
                </el-descriptions-item>
                <!-- <el-descriptions-item :label="form.delivery == '0'?'期望上门时间':'预计到货时间'">
                  <span>{{ parseTime(form.expectTime, '{y}-{m}-{d}') }}</span>
                </el-descriptions-item> -->
                <el-descriptions-item label="物品数量">{{ form.properties }}</el-descriptions-item>
                <!-- <el-descriptions-item label="是否拖车">{{form.isTrailer == '0'?'否':'是'}}</el-descriptions-item> -->
                <el-descriptions-item label="入库仓库">{{ form.storeName }}</el-descriptions-item>
                <el-descriptions-item label="有无钥匙" v-if="form.carKey">{{ form.carKey }}</el-descriptions-item>
                <el-descriptions-item label="有无行驶证" v-if="form.driveLicen">{{ form.driveLicen }}</el-descriptions-item>
                <el-descriptions-item label="无" v-if="form.othreNone">{{ form.othreNone }}</el-descriptions-item>
                <el-descriptions-item label="申请备注" :span="4">{{ form.remark }}</el-descriptions-item>
                <el-descriptions-item label="附件" :span="4">
                  <!-- <el-image v-if="form.oss && form.oss.length > 0"
                    style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransfer(form.oss,'one')" fit="scale-down"
                    :preview-src-list="ossTransfer(form.oss,'list')"></el-image> -->
                  <el-image v-if="form.oss && form.oss.length > 0" v-for="(pic,pindex) in form.oss"
                            style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransferThumbnail(pic,'one')"
                            fit="scale-down"
                            :preview-src-list="ossTransfer(form.oss,'list')"
                  ></el-image>
                </el-descriptions-item>
              </el-descriptions>
            </el-card>
            <el-card v-if="show" class="mt10">
              <el-descriptions title="下发信息" :column="3" border>
                <el-descriptions-item label="存放位置" :span="3">
                  <el-radio-group v-model="sendTaskForm.storeId">
                    <el-radio-button v-for="item in storeOptions" :key="item.id" :label="item.id">
                      {{ item.label }}
                    </el-radio-button>
                  </el-radio-group>
                </el-descriptions-item>
                <el-descriptions-item label="承运商" :span="3">
                  <el-radio-group v-model="sendTaskForm.carrierDeptId">
                    <el-radio-button v-for="item in carrierOptions" :key="item.deptId" :label="item.deptId">
                      {{ item.carrierName }}
                    </el-radio-button>
                  </el-radio-group>
                </el-descriptions-item>
                <template>
                  <el-descriptions-item label="派遣车辆" :span="2">
                    <el-select v-model="sendTaskForm.carId">
                      <el-option v-for="item in carOptions" :key="item.id" :label="item.carNumber" :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-descriptions-item>
                  <el-descriptions-item label="取件人" :span="1">
                    <el-select v-model="sendTaskForm.pickupId">
                      <el-option v-for="item in userOptions" :key="item.userId" :label="item.nickName"
                                 :value="item.userId"
                      ></el-option>
                    </el-select>
                  </el-descriptions-item>
                </template>
              </el-descriptions>
              <div class="mt10 fr mb10">
                <el-button type="primary" :loading="buttonLoading" @click="submitForm" size="mini">确 定</el-button>
                <el-button @click="handleClose" size="mini">取 消</el-button>
              </div>
            </el-card>
            <handover-order :form="form" :handoverOptions="handoverOptions"
                            v-if="handoverOptions == null || handoverOptions.length == 0"
            ></handover-order>
          </el-tab-pane>
          <el-tab-pane label="物品清单" name="2">
            <el-table :data="form.items" border stripe>
              <el-table-column type="index" width="55" align="center"></el-table-column>
              <el-table-column label="物品编号" align="left" prop="pno" width="260">
                <template slot-scope="scope">
                  <span>{{ scope.row.pno }}</span>
                </template>
              </el-table-column>
              <el-table-column label="物品名称" align="left" prop="name" width="200">
                <template slot-scope="scope">
                  <span>{{ scope.row.name }}</span>
                </template>
              </el-table-column>
              <el-table-column label="数量" align="center" prop="nums" width="75">
                <template slot-scope="scope">
                  <span>{{ scope.row.nums }}</span>
                </template>
              </el-table-column>
              <!-- <el-table-column label="箱号" align="center" prop="boxNo">
                <template slot-scope="scope" v-if="scope.row.boxNo">
                  <el-tag>{{scope.row.boxNo}}</el-tag>
                </template>
              </el-table-column> -->
              <el-table-column label="图片" align="left" prop="oss">
                <template slot-scope="scope">
                  <!-- <el-image v-if="scope.row.oss.length > 0"
                    style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransfer(scope.row.oss,'one')" fit="scale-down"
                    :preview-src-list="ossTransfer(scope.row.oss,'list')"></el-image> -->
                  <el-image v-if="scope.row.oss && scope.row.oss.length > 0" v-for="(pic,pindex) in scope.row.oss"
                            style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransferThumbnail(pic,'one')"
                            fit="scale-down"
                            :preview-src-list="ossTransfer(scope.row.oss,'list')"
                  ></el-image>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="交接信息" name="3" v-if="handoverOptions && handoverOptions.length > 0">
            <handover-order :form="form" :handoverOptions="handoverOptions"
                            v-if="handoverOptions && handoverOptions.length > 0"
            ></handover-order>
          </el-tab-pane>
          <el-tab-pane label="交接原件" name="4">
            <el-card shadow="never">
              <div slot="header">
                <image-upload v-model="handoverOssList"/>
                <el-button style="position: absolute;right: 10px;top: 0;" type="text" @click="handoverUpload">重新上传
                </el-button>
              </div>
              <el-image v-for="(pic,pindex) in handoverOssList"
                        style="width: 100%;" :src="ossTransfer(pic,'list')" fit="scale-down"
                        :preview-src-list="ossTransfer(handoverOssList,'list')"
              ></el-image>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="配送信息" name="5" v-if="orderOptions">
            <el-tabs tab-position="left">
              <el-tab-pane label="订单信息">
                <el-descriptions title="基本信息" :column="3" border>
                  <el-descriptions-item label="订单编号">{{ orderOptions.orderNo }}</el-descriptions-item>
                  <el-descriptions-item label="所属部门">{{ orderOptions.deptName }}</el-descriptions-item>
                  <el-descriptions-item label="物品数量">{{ orderOptions.nums }}</el-descriptions-item>
                  <el-descriptions-item label="客户名称" v-if="orderOptions.clientName">{{ orderOptions.clientName }}
                  </el-descriptions-item>
                  <el-descriptions-item label="联系人" v-if="orderOptions.clientContacts">
                    {{ orderOptions.clientContacts }}
                  </el-descriptions-item>
                  <el-descriptions-item label="联系电话" v-if="orderOptions.clientTel">{{ orderOptions.clientTel }}
                  </el-descriptions-item>
                  <el-descriptions-item label="备注" :span="3">{{ orderOptions.memo }}</el-descriptions-item>
                </el-descriptions>
                <el-descriptions title="寄收地址" :column="3" border style="margin-top: 15px;">
                  <el-descriptions-item label="寄件单位">{{ orderOptions.sendAddr }}</el-descriptions-item>
                  <el-descriptions-item label="寄件联系人">{{ orderOptions.sendContacts }}</el-descriptions-item>
                  <el-descriptions-item label="联系方式">{{ orderOptions.sendTel }}</el-descriptions-item>
                  <el-descriptions-item label="寄件地址" :span="3">{{ orderOptions.sendAddress }}</el-descriptions-item>
                  <el-descriptions-item label="收件单位">{{ orderOptions.takeAddr }}</el-descriptions-item>
                  <el-descriptions-item label="收件联系人">{{ orderOptions.takeContacts }}</el-descriptions-item>
                  <el-descriptions-item label="联系方式">{{ orderOptions.takeTel }}</el-descriptions-item>
                  <el-descriptions-item label="收件地址" :span="3">{{ orderOptions.takeAddress }}</el-descriptions-item>
                </el-descriptions>
                <el-card style="margin-top: 15px;">
                  <div slot="header" class="clearfix">
                    <span style="font-weight: bold;">物品清单</span>
                  </div>
                  <el-table :data="orderOptions.items">
                    <el-table-column label="编号" prop="pno"/>
                    <el-table-column label="名称" prop="name"/>
                    <el-table-column label="数量" prop="nums"/>
                  </el-table>
                </el-card>
                <el-card v-if="form.buss == '1'">
                  <div slot="header" class="clearfix">
                    <span>车辆附件</span>
                  </div>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>全车外观正前</span>
                    </div>
                    <el-image v-if="orderOptions.facadeOss && orderOptions.facadeOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.facadeOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.facadeOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>全车外观正左</span>
                    </div>
                    <el-image v-if="orderOptions.facadeLeftOss && orderOptions.facadeLeftOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.facadeLeftOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.facadeLeftOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>全车外观正后</span>
                    </div>
                    <el-image v-if="orderOptions.facadeAfterOss && orderOptions.facadeAfterOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.facadeAfterOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.facadeAfterOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>全车外观正右</span>
                    </div>
                    <el-image v-if="orderOptions.facadeRightOss && orderOptions.facadeRightOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.facadeRightOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.facadeRightOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>仪表盘</span>
                    </div>
                    <el-image v-if="orderOptions.dashboardOss && orderOptions.dashboardOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.dashboardOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.dashboardOss,'list')"
                    ></el-image>
                  </el-card>

                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>车架号</span>
                    </div>
                    <!--    <template v-for="pics in orderOptions.carOss">
                          <el-image :src="pics.url" style="width: 120px;height: 80px;margin-right: 10px;"
                           :preview-src-list="[pics.url]"/>
                        </template> -->
                    <!-- <el-image
                      style="width: 120px; height: 80px;margin-right: 10px;" :src="ossTransfer(orderOptions.carOss,'one')" fit="scale-down"
                      :preview-src-list="ossTransfer(orderOptions.carOss,'list')"></el-image> -->
                    <el-image v-if="orderOptions.carOss && orderOptions.carOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.carOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.carOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>交接现场</span>
                    </div>
                    <!-- <template v-for="pics in orderOptions.handoverOss">
                      <el-image :src="pics.url" style="width: 120px;height: 80px;margin-right: 10px;"
                       :preview-src-list="[pics.url]"/>
                    </template> -->
                    <!-- <el-image
                      style="width: 120px; height: 80px;margin-right: 10px;" :src="ossTransfer(orderOptions.handoverOss,'one')" fit="scale-down"
                      :preview-src-list="ossTransfer(orderOptions.handoverOss,'list')"></el-image> -->
                    <el-image v-if="orderOptions.handoverOss && orderOptions.handoverOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.handoverOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.handoverOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%"
                           v-if="orderOptions.loadOss && orderOptions.loadOss.length > 0"
                  >
                    <div slot="header" class="clearfix">
                      <span>45度照片</span>
                    </div>
                    <!-- <template v-for="pics in orderOptions.loadOss">
                      <el-image :src="pics.url" style="width: 120px;height: 80px;margin-right: 10px;"
                       :preview-src-list="[pics.url]"/>
                    </template> -->
                    <!-- <el-image
                      style="width: 120px; height: 80px;margin-right: 10px;" :src="ossTransfer(orderOptions.loadOss,'one')" fit="scale-down"
                      :preview-src-list="ossTransfer(orderOptions.loadOss,'list')"></el-image> -->
                    <el-image v-if="orderOptions.loadOss && orderOptions.loadOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.loadOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.loadOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>外观瑕疵</span>
                    </div>
                    <!-- <template v-for="pics in orderOptions.loadOss">
                      <el-image :src="pics.url" style="width: 120px;height: 80px;margin-right: 10px;"
                       :preview-src-list="[pics.url]"/>
                    </template> -->
                    <!-- <el-image
                      style="width: 120px; height: 80px;margin-right: 10px;" :src="ossTransfer(orderOptions.loadOss,'one')" fit="scale-down"
                      :preview-src-list="ossTransfer(orderOptions.loadOss,'list')"></el-image> -->
                    <el-image v-if="orderOptions.flawOss && orderOptions.flawOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.flawOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.flawOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>到达目的地</span>
                    </div>
                    <!-- <template v-for="pics in orderOptions.takeOss">
                      <el-image :src="pics.url" style="width: 120px;height: 80px;margin-right: 10px;"
                       :preview-src-list="[pics.url]"/>
                    </template> -->
                    <!-- <el-image
                      style="width: 120px; height: 80px;margin-right: 10px;" :src="ossTransfer(orderOptions.takeOss,'one')" fit="scale-down"
                      :preview-src-list="ossTransfer(orderOptions.takeOss,'list')"></el-image> -->
                    <el-image v-if="orderOptions.takeOss && orderOptions.takeOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.takeOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.takeOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>卸车</span>
                    </div>
                    <!-- <template v-for="pics in orderOptions.unloadOss">
                      <el-image :src="pics.url" style="width: 120px;height: 80px;margin-right: 10px;"
                       :preview-src-list="[pics.url]"/>
                    </template> -->
                    <!-- <el-image
                       style="width: 120px; height: 80px;margin-right: 10px;" :src="ossTransfer(orderOptions.unloadOss,'one')" fit="scale-down"
                       :preview-src-list="ossTransfer(orderOptions.unloadOss,'list')"></el-image> -->
                    <el-image v-if="orderOptions.unloadOss && orderOptions.unloadOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.unloadOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.unloadOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>其他</span>
                    </div>
                    <!-- <template v-for="pics in orderOptions.otherOss">
                      <el-image :src="pics.url" style="width: 120px;height: 80px;margin-right: 10px;"
                       :preview-src-list="[pics.url]"/>
                    </template> -->
                    <!-- <el-image
                      style="width: 120px; height: 80px;margin-right: 10px;" :src="ossTransfer(orderOptions.otherOss,'one')" fit="scale-down"
                      :preview-src-list="ossTransfer(orderOptions.otherOss,'list')"></el-image> -->
                    <el-image v-if="orderOptions.otherOss && orderOptions.otherOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.otherOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.otherOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>其他</span>
                    </div>
                    <!-- <template v-for="pics in orderOptions.otherOss">
                      <el-image :src="pics.url" style="width: 120px;height: 80px;margin-right: 10px;"
                       :preview-src-list="[pics.url]"/>
                    </template> -->
                    <!-- <el-image
                      style="width: 120px; height: 80px;margin-right: 10px;" :src="ossTransfer(orderOptions.otherOss,'one')" fit="scale-down"
                      :preview-src-list="ossTransfer(orderOptions.otherOss,'list')"></el-image> -->
                    <el-image v-if="orderOptions.otherTwoOss && orderOptions.otherTwoOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.otherTwoOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.otherTwoOss,'list')"
                    ></el-image>
                  </el-card>
                </el-card>
              </el-tab-pane>
              <el-tab-pane label="运单信息" v-if="orderOptions.wayItems && orderOptions.wayItems.length > 0">
                <template v-for="item in orderOptions.wayItems">
                  <el-steps :active="item.status == 2?0:(item.status == 3?1:(item.status == 5?2:3))" align-center
                            process-status="finish" finish-status="success" simple style="margin-bottom: 10px;"
                  >
                    <el-step title="发车"></el-step>
                    <el-step title="到达"></el-step>
                    <el-step title="签收"></el-step>
                    <el-step title="完成"></el-step>
                  </el-steps>
                  <el-tabs v-model="wayName">
                    <el-tab-pane label="基本信息" name="1">
                      <el-descriptions :column="3" border>
                        <el-descriptions-item label="运单编号">{{ item.waybillNo }}</el-descriptions-item>
                        <el-descriptions-item label="线路">{{ item.lineName }}</el-descriptions-item>
                        <el-descriptions-item label="车次">{{ item.scheduleName }}</el-descriptions-item>
                        <el-descriptions-item label="车牌号">{{ item.carNumber }}</el-descriptions-item>
                        <el-descriptions-item label="司机" :span="2">{{ item.driverName }}</el-descriptions-item>
                        <el-descriptions-item label="物品数量">{{ item.nums }}</el-descriptions-item>
                      </el-descriptions>
                    </el-tab-pane>
                    <el-tab-pane label="物品清单" name="2">
                      <el-card>
                        <el-table :data="item.items">
                          <el-table-column label="编号" prop="pno"/>
                          <el-table-column label="名称" prop="name"/>
                          <el-table-column label="数量" prop="nums"/>
                        </el-table>
                      </el-card>

                    </el-tab-pane>
                    <el-tab-pane label="日志跟踪" name="3">
                      <el-card>
                        <el-table :data="item.logItems">
                          <el-table-column label="操作人" prop="operator"/>
                          <el-table-column label="节点名称">
                            <template slot-scope="scope">
                              <dict-tag :options="dict.type.tms_track_log_type" :value="scope.row.type"/>
                            </template>
                          </el-table-column>
                          <el-table-column label="操作时间" prop="createTime"></el-table-column>
                          <el-table-column label="备注" prop="memeo"/>
                        </el-table>
                      </el-card>
                    </el-tab-pane>
                  </el-tabs>
                </template>
              </el-tab-pane>
            </el-tabs>
          </el-tab-pane>
          <el-tab-pane label="上架任务" name="6" v-if="putTaskOptions">
            <el-descriptions title="基本信息" :column="3" border style="margin-top: 15px;">
              <el-descriptions-item label="任务编号">{{ putTaskOptions.taskNo }}</el-descriptions-item>
              <el-descriptions-item label="上架员">{{ putTaskOptions.nickName }}</el-descriptions-item>
              <el-descriptions-item label="状态">
                <dict-tag :options="dict.type.wms_put_task_status" :value="putTaskOptions.status"/>
              </el-descriptions-item>
            </el-descriptions>
            <el-card style="margin-top: 15px;">
              <div slot="header" class="clearfix">
                <span>物品清单</span>
              </div>
              <el-table :data="putTaskOptions.items">
                <el-table-column label="编号" prop="pno"/>
                <el-table-column label="名称" prop="name"/>
                <el-table-column label="数量" prop="nums"/>
                <el-table-column label="状态" prop="nums">
                  <template slot-scope="scope">
                    <dict-tag :options="dict.type.wms_put_task_status" :value="scope.row.status"/>
                  </template>
                </el-table-column>
              </el-table>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="视频记录" name="7">
            <el-card class="box-card" shadow="hover">
              <dh-video :task-id="form.id"/>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="操作日志" name="8">
            <el-table :data="logOptions" border stripe>
              <el-table-column label="序号" type="index" width="50" align="center"/>
              <el-table-column label="操作时间" align="left" prop="logTime" width="180"/>
              <el-table-column label="操作人" align="left" prop="operator" width="200"/>
              <el-table-column label="操作内容" align="left" prop="content"/>
            </el-table>
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </el-drawer>
    <el-drawer title="调用申请" :visible.sync="open" size="75%" :before-close="close" v-if="form.type == '3'">
      <div class="mb20 ml20">
        <span style="font-size: 20px;">{{ form.taskNo }}</span>
      </div>
      <el-card>
        <el-tabs v-model="activeName">
          <el-tab-pane label="申请详情" name="1">
            <el-card>
              <el-descriptions title="基本信息" :column="4" border>
                <el-descriptions-item label="申请单位" :span="2">{{ form.deptName }}</el-descriptions-item>
                <el-descriptions-item label="申请人">{{ form.name }}</el-descriptions-item>
                <el-descriptions-item label="联系电话">{{ form.tel }}</el-descriptions-item>
                <el-descriptions-item v-if="form.delivery == '0'" label="联系地址" :span="4">{{ form.address }}
                </el-descriptions-item>
                <el-descriptions-item label="物流配送">
                  <dict-tag :options="dict.type.oms_out_delivery_type" :value="form.delivery"/>
                </el-descriptions-item>
                <el-descriptions-item label="调用数量">{{ form.properties }}</el-descriptions-item>
                <el-descriptions-item label="调用仓库">{{ form.storeName }}</el-descriptions-item>
                <el-descriptions-item label="有无钥匙" v-if="form.carKey">{{ form.carKey }}</el-descriptions-item>
                <el-descriptions-item label="有无行驶证" v-if="form.driveLicen">{{ form.driveLicen }}</el-descriptions-item>
                <el-descriptions-item label="无" v-if="form.othreNone">{{ form.othreNone }}</el-descriptions-item>
                <el-descriptions-item label="调用原因" :span="4">{{ form.dispatchRemark }}</el-descriptions-item>
                <el-descriptions-item label="附件" :span="4">
                  <el-image v-if="form.oss && form.oss.length > 0" v-for="(pic,pindex) in form.oss"
                            style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransferThumbnail(pic,'one')"
                            fit="scale-down"
                            :preview-src-list="ossTransfer(form.oss,'list')"
                  ></el-image>
                </el-descriptions-item>
              </el-descriptions>
              <el-descriptions title="取件信息" :column="4" border v-if="form.delivery== '1'" class="mt10">
                <el-descriptions-item label="取件人">{{ returnForm.pickuper }}</el-descriptions-item>
                <el-descriptions-item label="联系电话">{{ returnForm.pickupTel }}</el-descriptions-item>
                <el-descriptions-item label="证件类型">
                  <template v-for="dict in dict.type.oms_task_card_type">
                    <span v-if="dict.value == returnForm.pickupCardType">{{ dict.label }}</span>
                  </template>
                </el-descriptions-item>
                <el-descriptions-item label="证件号">{{ returnForm.pickupCard }}</el-descriptions-item>
              </el-descriptions>
            </el-card>
            <el-card v-if="show" class="mt10">
              <el-descriptions title="下发信息" :column="3" border>
                <el-descriptions-item label="存放位置" :span="3">
                  <el-radio-group v-model="sendTaskForm.storeId">
                    <el-radio-button v-for="item in storeOptions" :key="item.id" :label="item.id">
                      {{ item.label }}
                    </el-radio-button>
                  </el-radio-group>
                </el-descriptions-item>
                <el-descriptions-item label="承运商" :span="3">
                  <el-radio-group v-model="sendTaskForm.carrierDeptId">
                    <el-radio-button v-for="item in carrierOptions" :key="item.deptId" :label="item.deptId">
                      {{ item.carrierName }}
                    </el-radio-button>
                  </el-radio-group>
                </el-descriptions-item>
                <template>
                  <el-descriptions-item label="派遣车辆" :span="2">
                    <el-select v-model="sendTaskForm.carId">
                      <el-option v-for="item in carOptions" :key="item.id" :label="item.carNumber" :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-descriptions-item>
                  <el-descriptions-item label="取件人" :span="1">
                    <el-select v-model="sendTaskForm.pickupId">
                      <el-option v-for="item in userOptions" :key="item.userId" :label="item.nickName"
                                 :value="item.userId"
                      ></el-option>
                    </el-select>
                  </el-descriptions-item>
                </template>
              </el-descriptions>
              <div class="mt10 fr mb10">
                <el-button type="primary" :loading="buttonLoading" @click="submitForm" size="mini">确 定</el-button>
                <el-button @click="handleClose" size="mini">取 消</el-button>
              </div>
            </el-card>
            <handover-order :form="form" :handoverOptions="handoverOptions"
                            v-if="handoverOptions == null || handoverOptions.length == 0"
            ></handover-order>
          </el-tab-pane>
          <el-tab-pane label="物品清单" name="2">
            <el-table :data="form.items" border stripe>
              <el-table-column type="index" width="55" align="center"></el-table-column>
              <el-table-column label="物品编号" align="left" prop="pno" width="260">
                <template slot-scope="scope">
                  <span>{{ scope.row.pno }}</span>
                </template>
              </el-table-column>
              <el-table-column label="物品名称" align="left" prop="name" width="200">
                <template slot-scope="scope">
                  <span>{{ scope.row.name }}</span>
                </template>
              </el-table-column>
              <el-table-column label="数量" align="center" prop="nums" width="75">
                <template slot-scope="scope">
                  <span>{{ scope.row.nums }}</span>
                </template>
              </el-table-column>
              <el-table-column label="图片" align="left" prop="oss">
                <template slot-scope="scope">
                  <el-image v-if="scope.row.oss && scope.row.oss.length > 0" v-for="(pic,pindex) in scope.row.oss"
                            style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransferThumbnail(pic,'one')"
                            fit="scale-down"
                            :preview-src-list="ossTransfer(scope.row.oss,'list')"
                  ></el-image>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="交接信息" name="3" v-if="handoverOptions && handoverOptions.length > 0">
            <handover-order :form="form" :handoverOptions="handoverOptions"
                            v-if="handoverOptions && handoverOptions.length > 0"
            ></handover-order>
          </el-tab-pane>
          <el-tab-pane label="交接原件" name="4" v-if="handoverOssList && handoverOssList.length > 0">
            <el-card shadow="never">
              <div slot="header">
                <image-upload v-model="handoverOssList"/>
                <el-button style="position: absolute;right: 10px;top: 0;" type="text" @click="handoverUpload">重新上传
                </el-button>
              </div>
              <el-image v-for="(pic,pindex) in handoverOssList"
                        style="width: 100%;" :src="ossTransfer(pic,'list')" fit="scale-down"
                        :preview-src-list="ossTransfer(handoverOssList,'list')"
              ></el-image>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="配送信息" name="5" v-if="orderOptions">
            <el-tabs tab-position="left">
              <el-tab-pane label="订单信息">
                <el-descriptions title="基本信息" :column="3" border>
                  <el-descriptions-item label="订单编号">{{ orderOptions.orderNo }}</el-descriptions-item>
                  <el-descriptions-item label="所属部门">{{ orderOptions.deptName }}</el-descriptions-item>
                  <el-descriptions-item label="物品数量">{{ orderOptions.nums }}</el-descriptions-item>
                  <el-descriptions-item label="客户名称" v-if="orderOptions.clientName">{{ orderOptions.clientName }}
                  </el-descriptions-item>
                  <el-descriptions-item label="联系人" v-if="orderOptions.clientContacts">
                    {{ orderOptions.clientContacts }}
                  </el-descriptions-item>
                  <el-descriptions-item label="联系电话" v-if="orderOptions.clientTel">{{ orderOptions.clientTel }}
                  </el-descriptions-item>
                  <el-descriptions-item label="备注" :span="3">{{ orderOptions.memo }}</el-descriptions-item>
                </el-descriptions>
                <el-descriptions title="寄收地址" :column="3" border style="margin-top: 15px;">
                  <el-descriptions-item label="寄件单位">{{ orderOptions.sendAddr }}</el-descriptions-item>
                  <el-descriptions-item label="寄件联系人">{{ orderOptions.sendContacts }}</el-descriptions-item>
                  <el-descriptions-item label="联系方式">{{ orderOptions.sendTel }}</el-descriptions-item>
                  <el-descriptions-item label="寄件地址" :span="3">{{ orderOptions.sendAddress }}</el-descriptions-item>
                  <el-descriptions-item label="收件单位">{{ orderOptions.takeAddr }}</el-descriptions-item>
                  <el-descriptions-item label="收件联系人">{{ orderOptions.takeContacts }}</el-descriptions-item>
                  <el-descriptions-item label="联系方式">{{ orderOptions.takeTel }}</el-descriptions-item>
                  <el-descriptions-item label="收件地址" :span="3">{{ orderOptions.takeAddress }}</el-descriptions-item>
                </el-descriptions>
                <el-card style="margin-top: 15px;">
                  <div slot="header" class="clearfix">
                    <span style="font-weight: bold;">物品清单</span>
                  </div>
                  <el-table :data="orderOptions.items">
                    <el-table-column label="编号" prop="pno"/>
                    <el-table-column label="名称" prop="name"/>
                    <el-table-column label="数量" prop="nums"/>
                  </el-table>
                </el-card>
                <el-card v-if="form.buss == '1'">
                  <div slot="header" class="clearfix">
                    <span>车辆附件</span>
                  </div>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>全车外观</span>
                    </div>
                    <el-image v-if="orderOptions.facadeOss && orderOptions.facadeOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.facadeOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.facadeOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>车架号</span>
                    </div>
                    <el-image v-if="orderOptions.carOss && orderOptions.carOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.carOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.carOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>交接现场</span>
                    </div>
                    <el-image v-if="orderOptions.handoverOss && orderOptions.handoverOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.handoverOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.handoverOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%"
                           v-if="orderOptions.loadOss && orderOptions.loadOss.length > 0"
                  >
                    <div slot="header" class="clearfix">
                      <span>45度装车</span>
                    </div>
                    <el-image v-if="orderOptions.loadOss && orderOptions.loadOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.loadOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.loadOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>外观瑕疵</span>
                    </div>
                    <el-image v-if="orderOptions.flawOss && orderOptions.flawOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.flawOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.flawOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>到达目的地</span>
                    </div>
                    <el-image v-if="orderOptions.takeOss && orderOptions.takeOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.takeOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.takeOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>卸车</span>
                    </div>
                    <el-image v-if="orderOptions.unloadOss && orderOptions.unloadOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.unloadOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.unloadOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>其他</span>
                    </div>
                    <el-image v-if="orderOptions.otherOss && orderOptions.otherOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.otherOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.otherOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>其他</span>
                    </div>
                    <el-image v-if="orderOptions.otherTwoOss && orderOptions.otherTwoOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.otherTwoOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.otherTwoOss,'list')"
                    ></el-image>
                  </el-card>
                </el-card>
              </el-tab-pane>
              <el-tab-pane label="运单信息" v-if="orderOptions.wayItems && orderOptions.wayItems.length > 0">
                <template v-for="item in orderOptions.wayItems">
                  <el-steps :active="item.status == 2?0:(item.status == 3?1:(item.status == 5?2:3))" align-center
                            process-status="finish" finish-status="success" simple style="margin-bottom: 10px;"
                  >
                    <el-step title="发车"></el-step>
                    <el-step title="到达"></el-step>
                    <el-step title="签收"></el-step>
                    <el-step title="完成"></el-step>
                  </el-steps>
                  <el-tabs v-model="wayName">
                    <el-tab-pane label="基本信息" name="1">
                      <el-descriptions :column="3" border>
                        <el-descriptions-item label="运单编号">{{ item.waybillNo }}</el-descriptions-item>
                        <el-descriptions-item label="线路">{{ item.lineName }}</el-descriptions-item>
                        <el-descriptions-item label="车次">{{ item.scheduleName }}</el-descriptions-item>
                        <el-descriptions-item label="车牌号">{{ item.carNumber }}</el-descriptions-item>
                        <el-descriptions-item label="司机" :span="2">{{ item.driverName }}</el-descriptions-item>
                        <el-descriptions-item label="物品数量">{{ item.nums }}</el-descriptions-item>
                      </el-descriptions>
                    </el-tab-pane>
                    <el-tab-pane label="物品清单" name="2">
                      <el-card>
                        <el-table :data="item.items">
                          <el-table-column label="编号" prop="pno"/>
                          <el-table-column label="名称" prop="name"/>
                          <el-table-column label="数量" prop="nums"/>
                        </el-table>
                      </el-card>

                    </el-tab-pane>
                    <el-tab-pane label="日志跟踪" name="3">
                      <el-card>
                        <el-table :data="item.logItems">
                          <el-table-column label="操作人" prop="operator"/>
                          <el-table-column label="节点名称">
                            <template slot-scope="scope">
                              <dict-tag :options="dict.type.tms_track_log_type" :value="scope.row.type"/>
                            </template>
                          </el-table-column>
                          <el-table-column label="操作时间" prop="createTime"></el-table-column>
                          <el-table-column label="备注" prop="memeo"/>
                        </el-table>
                      </el-card>
                    </el-tab-pane>
                  </el-tabs>
                </template>
              </el-tab-pane>
            </el-tabs>
          </el-tab-pane>
          <el-tab-pane label="挑拣任务" name="6" v-if="putTaskOptions && putTaskOptions.length > 0">
            <template v-for="item in putTaskOptions">
              <el-card style="margin-bottom: 15px;">
                <!-- <el-button v-if="form.type == '2'" class="fr mb10" type="primary" size="mini" @click="handlePick(item)">挑拣</el-button> -->
                <el-descriptions :column="3" border>
                  <el-descriptions-item label="任务编号">{{ item.pickNo }}</el-descriptions-item>
                  <el-descriptions-item label="挑拣员">{{ item.nickName }}</el-descriptions-item>
                  <el-descriptions-item label="状态">
                    <dict-tag :options="dict.type.wms_pick_task_status" :value="item.status"/>
                  </el-descriptions-item>
                </el-descriptions>
                <el-card style="margin-top: 15px;" shadow="never">
                  <div slot="header" class="clearfix">
                    <span>物品清单</span>
                  </div>
                  <el-table :data="item.items">
                    <el-table-column label="编号" prop="pno"/>
                    <el-table-column label="名称" prop="name"/>
                    <el-table-column label="数量" prop="nums"/>
                    <el-table-column label="状态" prop="nums">
                      <template slot-scope="scope">
                        <dict-tag :options="dict.type.wms_pick_task_status" :value="scope.row.status"/>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-card>
              </el-card>
            </template>
          </el-tab-pane>
          <el-tab-pane label="视频记录" name="7">
            <el-card class="box-card" shadow="hover">
              <dh-video :task-id="form.id"/>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="操作日志" name="8">
            <el-table :data="logOptions" border stripe>
              <el-table-column label="序号" type="index" width="50" align="center"/>
              <el-table-column label="操作时间" align="left" prop="logTime" width="180"/>
              <el-table-column label="操作人" align="left" prop="operator" width="200"/>
              <el-table-column label="操作内容" align="left" prop="content"/>
            </el-table>
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </el-drawer>
    <el-drawer title="出库申请" :visible.sync="open" size="75%" :before-close="close" v-if="form.type=='1'">
      <div class="mb20 ml20">
        <span style="font-size: 20px;">{{ form.taskNo }}</span>
      </div>
      <el-card>
        <el-tabs v-model="activeName">
          <el-tab-pane label="申请详情" name="1">
            <el-card>
              <el-descriptions title="基本信息" :column="4" border>
                <el-descriptions-item label="申请单位" :span="2">{{ form.deptName }}</el-descriptions-item>
                <el-descriptions-item label="申请人">{{ form.name }}</el-descriptions-item>
                <el-descriptions-item label="联系电话">{{ form.tel }}</el-descriptions-item>
                <el-descriptions-item v-if="form.delivery == '0'" label="联系地址" :span="4">{{ form.address }}
                </el-descriptions-item>
                <el-descriptions-item label="物流配送">
                  <dict-tag :options="dict.type.oms_out_delivery_type" :value="form.delivery"/>
                </el-descriptions-item>
                <el-descriptions-item label="出库数量">{{ form.properties }}</el-descriptions-item>
                <!-- <el-descriptions-item label="是否拖车">{{form.isTrailer == '0'?'否':'是'}}</el-descriptions-item> -->
                <el-descriptions-item label="出库仓库">{{ form.storeName }}</el-descriptions-item>
                <el-descriptions-item label="有无钥匙" v-if="form.carKey">{{ form.carKey }}</el-descriptions-item>
                <el-descriptions-item label="有无行驶证" v-if="form.driveLicen">{{ form.driveLicen }}</el-descriptions-item>
                <el-descriptions-item label="无" v-if="form.othreNone">{{ form.othreNone }}</el-descriptions-item>
                <el-descriptions-item label="出库原因" :span="4">{{ form.remark }}</el-descriptions-item>
                <el-descriptions-item label="附件" :span="4">
                  <el-image v-if="form.oss && form.oss.length > 0" v-for="(pic,pindex) in form.oss"
                            style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransferThumbnail(pic,'one')"
                            fit="scale-down"
                            :preview-src-list="ossTransfer(form.oss,'list')"
                  ></el-image>
                </el-descriptions-item>
              </el-descriptions>
              <el-descriptions title="取件信息" :column="4" border v-if="form.delivery== '1'" class="mt10">
                <el-descriptions-item label="取件人">{{ returnForm.pickuper }}</el-descriptions-item>
                <el-descriptions-item label="联系电话">{{ returnForm.pickupTel }}</el-descriptions-item>
                <el-descriptions-item label="证件类型">
                  <template v-for="dict in dict.type.oms_task_card_type">
                    <span v-if="dict.value == returnForm.pickupCardType">{{ dict.label }}</span>
                  </template>
                </el-descriptions-item>
                <el-descriptions-item label="证件号">{{ returnForm.pickupCard }}</el-descriptions-item>
              </el-descriptions>
            </el-card>
            <el-card v-if="show" class="mt10">
              <el-descriptions title="下发信息" :column="3" border>
                <el-descriptions-item label="存放位置" :span="3">
                  <el-radio-group v-model="sendTaskForm.storeId">
                    <el-radio-button v-for="item in storeOptions" :key="item.id" :label="item.id">
                      {{ item.label }}
                    </el-radio-button>
                  </el-radio-group>
                </el-descriptions-item>
                <el-descriptions-item label="承运商" :span="3">
                  <el-radio-group v-model="sendTaskForm.carrierDeptId">
                    <el-radio-button v-for="item in carrierOptions" :key="item.deptId" :label="item.deptId">
                      {{ item.carrierName }}
                    </el-radio-button>
                  </el-radio-group>
                </el-descriptions-item>
                <template>
                  <el-descriptions-item label="派遣车辆" :span="2">
                    <el-select v-model="sendTaskForm.carId">
                      <el-option v-for="item in carOptions" :key="item.id" :label="item.carNumber" :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-descriptions-item>
                  <el-descriptions-item label="取件人" :span="1">
                    <el-select v-model="sendTaskForm.pickupId">
                      <el-option v-for="item in userOptions" :key="item.userId" :label="item.nickName"
                                 :value="item.userId"
                      ></el-option>
                    </el-select>
                  </el-descriptions-item>
                </template>
              </el-descriptions>
              <div class="mt10 fr mb10">
                <el-button type="primary" :loading="buttonLoading" @click="submitForm" size="mini">确 定</el-button>
                <el-button @click="handleClose" size="mini">取 消</el-button>
              </div>
            </el-card>
            <handover-order :form="form" :handoverOptions="handoverOptions"
                            v-if="handoverOptions == null || handoverOptions.length == 0"
            ></handover-order>
          </el-tab-pane>
          <el-tab-pane label="物品清单" name="2">
            <el-table :data="form.items" border stripe>
              <el-table-column type="index" width="55" align="center"></el-table-column>
              <el-table-column label="物品编号" align="left" prop="pno" width="260">
                <template slot-scope="scope">
                  <span>{{ scope.row.pno }}</span>
                </template>
              </el-table-column>
              <el-table-column label="物品名称" align="left" prop="name" width="200">
                <template slot-scope="scope">
                  <span>{{ scope.row.name }}</span>
                </template>
              </el-table-column>
              <el-table-column label="数量" align="center" prop="nums" width="75">
                <template slot-scope="scope">
                  <span>{{ scope.row.nums }}</span>
                </template>
              </el-table-column>
              <el-table-column label="图片" align="left" prop="oss">
                <template slot-scope="scope">
                  <el-image v-if="scope.row.oss && scope.row.oss.length > 0" v-for="(pic,pindex) in scope.row.oss"
                            style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransferThumbnail(pic,'one')"
                            fit="scale-down"
                            :preview-src-list="ossTransfer(scope.row.oss,'list')"
                  ></el-image>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="交接信息" name="3" v-if="handoverOptions && handoverOptions.length > 0">
            <handover-order :form="form" :handoverOptions="handoverOptions"
                            v-if="handoverOptions && handoverOptions.length > 0"
            ></handover-order>
          </el-tab-pane>
          <el-tab-pane label="交接原件" name="4" v-if="handoverOssList && handoverOssList.length > 0">
            <el-card shadow="never">
              <div slot="header">
                <image-upload v-model="handoverOssList"/>
                <el-button style="position: absolute;right: 10px;top: 0;" type="text" @click="handoverUpload">重新上传
                </el-button>
              </div>
              <el-image v-for="(pic,pindex) in handoverOssList"
                        style="width: 100%;" :src="ossTransfer(pic,'list')" fit="scale-down"
                        :preview-src-list="ossTransfer(handoverOssList,'list')"
              ></el-image>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="配送信息" name="5" v-if="orderOptions">
            <el-tabs tab-position="left">
              <el-tab-pane label="订单信息">
                <el-descriptions title="基本信息" :column="3" border>
                  <el-descriptions-item label="订单编号">{{ orderOptions.orderNo }}</el-descriptions-item>
                  <el-descriptions-item label="所属部门">{{ orderOptions.deptName }}</el-descriptions-item>
                  <el-descriptions-item label="物品数量">{{ orderOptions.nums }}</el-descriptions-item>
                  <el-descriptions-item label="客户名称" v-if="orderOptions.clientName">{{ orderOptions.clientName }}
                  </el-descriptions-item>
                  <el-descriptions-item label="联系人" v-if="orderOptions.clientContacts">
                    {{ orderOptions.clientContacts }}
                  </el-descriptions-item>
                  <el-descriptions-item label="联系电话" v-if="orderOptions.clientTel">{{ orderOptions.clientTel }}
                  </el-descriptions-item>
                  <el-descriptions-item label="备注" :span="3">{{ orderOptions.memo }}</el-descriptions-item>
                </el-descriptions>
                <el-descriptions title="寄收地址" :column="3" border style="margin-top: 15px;">
                  <el-descriptions-item label="寄件单位">{{ orderOptions.sendAddr }}</el-descriptions-item>
                  <el-descriptions-item label="寄件联系人">{{ orderOptions.sendContacts }}</el-descriptions-item>
                  <el-descriptions-item label="联系方式">{{ orderOptions.sendTel }}</el-descriptions-item>
                  <el-descriptions-item label="寄件地址" :span="3">{{ orderOptions.sendAddress }}</el-descriptions-item>
                  <el-descriptions-item label="收件单位">{{ orderOptions.takeAddr }}</el-descriptions-item>
                  <el-descriptions-item label="收件联系人">{{ orderOptions.takeContacts }}</el-descriptions-item>
                  <el-descriptions-item label="联系方式">{{ orderOptions.takeTel }}</el-descriptions-item>
                  <el-descriptions-item label="收件地址" :span="3">{{ orderOptions.takeAddress }}</el-descriptions-item>
                </el-descriptions>
                <el-card style="margin-top: 15px;">
                  <div slot="header" class="clearfix">
                    <span style="font-weight: bold;">物品清单</span>
                  </div>
                  <el-table :data="orderOptions.items">
                    <el-table-column label="编号" prop="pno"/>
                    <el-table-column label="名称" prop="name"/>
                    <el-table-column label="数量" prop="nums"/>
                  </el-table>
                </el-card>
                <el-card v-if="form.buss == '1'">
                  <div slot="header" class="clearfix">
                    <span>车辆附件</span>
                  </div>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>全车外观</span>
                    </div>
                    <el-image v-if="orderOptions.facadeOss && orderOptions.facadeOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.facadeOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.facadeOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>车架号</span>
                    </div>
                    <el-image v-if="orderOptions.carOss && orderOptions.carOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.carOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.carOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>交接现场</span>
                    </div>
                    <el-image v-if="orderOptions.handoverOss && orderOptions.handoverOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.handoverOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.handoverOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%"
                           v-if="orderOptions.loadOss && orderOptions.loadOss.length > 0"
                  >
                    <div slot="header" class="clearfix">
                      <span>45度装车</span>
                    </div>
                    <el-image v-if="orderOptions.loadOss && orderOptions.loadOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.loadOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.loadOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>外观瑕疵</span>
                    </div>
                    <el-image v-if="orderOptions.flawOss && orderOptions.flawOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.flawOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.flawOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>到达目的地</span>
                    </div>
                    <el-image v-if="orderOptions.takeOss && orderOptions.takeOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.takeOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.takeOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>卸车</span>
                    </div>
                    <el-image v-if="orderOptions.unloadOss && orderOptions.unloadOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.unloadOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.unloadOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>其他</span>
                    </div>
                    <el-image v-if="orderOptions.otherOss && orderOptions.otherOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.otherOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.otherOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>其他</span>
                    </div>
                    <el-image v-if="orderOptions.otherTwoOss && orderOptions.otherTwoOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.otherTwoOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.otherTwoOss,'list')"
                    ></el-image>
                  </el-card>
                </el-card>
              </el-tab-pane>
              <el-tab-pane label="运单信息" v-if="orderOptions.wayItems && orderOptions.wayItems.length > 0">
                <template v-for="item in orderOptions.wayItems">
                  <el-steps :active="item.status == 2?0:(item.status == 3?1:(item.status == 5?2:3))" align-center
                            process-status="finish" finish-status="success" simple style="margin-bottom: 10px;"
                  >
                    <el-step title="发车"></el-step>
                    <el-step title="到达"></el-step>
                    <el-step title="签收"></el-step>
                    <el-step title="完成"></el-step>
                  </el-steps>
                  <el-tabs v-model="wayName">
                    <el-tab-pane label="基本信息" name="1">
                      <el-descriptions :column="3" border>
                        <el-descriptions-item label="运单编号">{{ item.waybillNo }}</el-descriptions-item>
                        <el-descriptions-item label="线路">{{ item.lineName }}</el-descriptions-item>
                        <el-descriptions-item label="车次">{{ item.scheduleName }}</el-descriptions-item>
                        <el-descriptions-item label="车牌号">{{ item.carNumber }}</el-descriptions-item>
                        <el-descriptions-item label="司机" :span="2">{{ item.driverName }}</el-descriptions-item>
                        <el-descriptions-item label="物品数量">{{ item.nums }}</el-descriptions-item>
                      </el-descriptions>
                    </el-tab-pane>
                    <el-tab-pane label="物品清单" name="2">
                      <el-card>
                        <el-table :data="item.items">
                          <el-table-column label="编号" prop="pno"/>
                          <el-table-column label="名称" prop="name"/>
                          <el-table-column label="数量" prop="nums"/>
                        </el-table>
                      </el-card>

                    </el-tab-pane>
                    <el-tab-pane label="日志跟踪" name="3">
                      <el-card>
                        <el-table :data="item.logItems">
                          <el-table-column label="操作人" prop="operator"/>
                          <el-table-column label="节点名称">
                            <template slot-scope="scope">
                              <dict-tag :options="dict.type.tms_track_log_type" :value="scope.row.type"/>
                            </template>
                          </el-table-column>
                          <el-table-column label="操作时间" prop="createTime"></el-table-column>
                          <el-table-column label="备注" prop="memeo"/>
                        </el-table>
                      </el-card>
                    </el-tab-pane>
                  </el-tabs>
                </template>
              </el-tab-pane>
            </el-tabs>
          </el-tab-pane>
          <el-tab-pane label="挑拣任务" name="6" v-if="putTaskOptions && putTaskOptions.length > 0">
            <template v-for="item in putTaskOptions">
              <el-card style="margin-bottom: 15px;">
                <el-descriptions :column="3" border>
                  <el-descriptions-item label="任务编号">{{ item.pickNo }}</el-descriptions-item>
                  <el-descriptions-item label="挑拣员">{{ item.nickName }}</el-descriptions-item>
                  <el-descriptions-item label="状态">
                    <dict-tag :options="dict.type.wms_pick_task_status" :value="item.status"/>
                  </el-descriptions-item>
                </el-descriptions>
                <el-card style="margin-top: 15px;" shadow="never">
                  <div slot="header" class="clearfix">
                    <span>物品清单</span>
                  </div>
                  <el-table :data="item.items">
                    <el-table-column label="编号" prop="pno"/>
                    <el-table-column label="名称" prop="name"/>
                    <el-table-column label="数量" prop="nums"/>
                    <el-table-column label="状态" prop="nums">
                      <template slot-scope="scope">
                        <dict-tag :options="dict.type.wms_pick_task_status" :value="scope.row.status"/>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-card>
              </el-card>
            </template>
          </el-tab-pane>
          <el-tab-pane label="视频记录" name="7">
            <el-card class="box-card" shadow="hover">
              <dh-video :task-id="form.id"/>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="操作日志" name="8">
            <el-table :data="logOptions" border stripe>
              <el-table-column label="序号" type="index" width="50" align="center"/>
              <el-table-column label="操作时间" align="left" prop="logTime" width="180"/>
              <el-table-column label="操作人" align="left" prop="operator" width="200"/>
              <el-table-column label="操作内容" align="left" prop="content"/>
            </el-table>
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </el-drawer>
    <el-drawer title="处置申请" :visible.sync="open" size="75%" :before-close="close" v-if="form.type=='2'">
      <div class="mb20 ml20">
        <span style="font-size: 20px;">{{ form.taskNo }}</span>
      </div>
      <el-card>
        <el-tabs v-model="activeName">
          <el-tab-pane label="申请详情" name="1">
            <el-card>
              <el-descriptions title="基本信息" :column="4" border>
                <el-descriptions-item label="申请单位" :span="2">{{ form.deptName }}</el-descriptions-item>
                <el-descriptions-item label="申请人">{{ form.name }}</el-descriptions-item>
                <el-descriptions-item label="联系电话">{{ form.tel }}</el-descriptions-item>
                <el-descriptions-item v-if="form.delivery == '0'" label="寄件地址" :span="4">{{ form.address }}
                </el-descriptions-item>
                <el-descriptions-item label="物流配送">
                  <dict-tag :options="dict.type.oms_out_delivery_type" :value="form.delivery"/>
                </el-descriptions-item>
                <el-descriptions-item label="处置数量">{{ form.properties }}</el-descriptions-item>
                <el-descriptions-item label="处置仓库">{{ form.storeName }}</el-descriptions-item>
                <el-descriptions-item label="有无钥匙" v-if="form.carKey">{{ form.carKey }}</el-descriptions-item>
                <el-descriptions-item label="有无行驶证" v-if="form.driveLicen">{{ form.driveLicen }}</el-descriptions-item>
                <el-descriptions-item label="无" v-if="form.othreNone">{{ form.othreNone }}</el-descriptions-item>
                <el-descriptions-item label="处置原因" :span="4">{{ form.remark }}</el-descriptions-item>
                <el-descriptions-item label="附件" :span="4">
                  <el-image v-if="form.oss && form.oss.length > 0" v-for="(pic,pindex) in form.oss"
                            style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransferThumbnail(pic,'one')"
                            fit="scale-down"
                            :preview-src-list="ossTransfer(form.oss,'list')"
                  ></el-image>
                </el-descriptions-item>
              </el-descriptions>
              <el-descriptions title="取件信息" :column="4" border v-if="form.delivery== '1'" class="mt10">
                <el-descriptions-item label="取件人">{{ returnForm.pickuper }}</el-descriptions-item>
                <el-descriptions-item label="联系电话">{{ returnForm.pickupTel }}</el-descriptions-item>
                <el-descriptions-item label="证件类型">
                  <span v-if="'0' == returnForm.pickupCardType">身份证</span>
                  <span v-if="'1' == returnForm.pickupCardType">人民警察证</span>
                </el-descriptions-item>
                <el-descriptions-item label="证件号">{{ returnForm.pickupCard }}</el-descriptions-item>
              </el-descriptions>
              <el-descriptions title="发还信息" :column="4" border v-if="form.dealType == '3' && form.isTrailer == '1'"
                               class="mt10"
              >
                <el-descriptions-item label="办案民警">{{ returnForm.police }}</el-descriptions-item>
                <el-descriptions-item label="民警电话">{{ returnForm.policeTel }}</el-descriptions-item>
                <el-descriptions-item label="发还人">{{ returnForm.backer }}</el-descriptions-item>
                <el-descriptions-item label="联系电话">{{ returnForm.backTel }}</el-descriptions-item>
                <el-descriptions-item label="身份证号码">{{ returnForm.backCard }}</el-descriptions-item>
                <el-descriptions-item label="附件" :span="3">
                  <el-image v-if="form.backOss && form.backOss.length > 0" v-for="(pic,pindex) in form.backOss"
                            style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransferThumbnail(pic,'one')"
                            fit="scale-down"
                            :preview-src-list="ossTransfer(form.backOss,'list')"
                  ></el-image>
                </el-descriptions-item>
              </el-descriptions>
            </el-card>
            <el-card v-if="show" class="mt10">
              <el-descriptions title="下发信息" :column="3" border>
                <el-descriptions-item label="存放位置" :span="3">
                  <el-radio-group v-model="sendTaskForm.storeId">
                    <el-radio-button v-for="item in storeOptions" :key="item.id" :label="item.id">
                      {{ item.label }}
                    </el-radio-button>
                  </el-radio-group>
                </el-descriptions-item>
                <el-descriptions-item label="承运商" :span="3">
                  <el-radio-group v-model="sendTaskForm.carrierDeptId">
                    <el-radio-button v-for="item in carrierOptions" :key="item.deptId" :label="item.deptId">
                      {{ item.carrierName }}
                    </el-radio-button>
                  </el-radio-group>
                </el-descriptions-item>
                <template>
                  <el-descriptions-item label="派遣车辆" :span="2">
                    <el-select v-model="sendTaskForm.carId">
                      <el-option v-for="item in carOptions" :key="item.id" :label="item.carNumber" :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-descriptions-item>
                  <el-descriptions-item label="取件人" :span="1">
                    <el-select v-model="sendTaskForm.pickupId">
                      <el-option v-for="item in userOptions" :key="item.userId" :label="item.nickName"
                                 :value="item.userId"
                      ></el-option>
                    </el-select>
                  </el-descriptions-item>
                </template>
              </el-descriptions>
              <div class="mt10 fr mb10">
                <el-button type="primary" :loading="buttonLoading" @click="submitForm" size="mini">确 定</el-button>
                <el-button @click="handleClose" size="mini">取 消</el-button>
              </div>
            </el-card>
            <handover-order :form="form" :handoverOptions="handoverOptions"
                            v-if="handoverOptions == null || handoverOptions.length == 0"
            ></handover-order>
          </el-tab-pane>
          <el-tab-pane label="物品清单" name="2">
            <el-table :data="form.items" border stripe>
              <el-table-column type="index" width="55" align="center"></el-table-column>
              <el-table-column label="物品编号" align="left" prop="pno" width="260">
                <template slot-scope="scope">
                  <span>{{ scope.row.pno }}</span>
                </template>
              </el-table-column>
              <el-table-column label="物品名称" align="left" prop="name" width="200">
                <template slot-scope="scope">
                  <span>{{ scope.row.name }}</span>
                </template>
              </el-table-column>
              <el-table-column label="数量" align="center" prop="nums" width="75">
                <template slot-scope="scope">
                  <span>{{ scope.row.nums }}</span>
                </template>
              </el-table-column>
              <el-table-column label="处置类型" align="center" prop="dealType" width="125">
                <template slot-scope="scope">
                  <dict-tag :options="dict.type.deal_type" :value="scope.row.dealType"/>
                </template>
              </el-table-column>
              <el-table-column label="图片" align="left" prop="oss">
                <template slot-scope="scope">
                  <el-image v-if="scope.row.oss && scope.row.oss.length > 0" v-for="(pic,pindex) in scope.row.oss"
                            style="width: 120px; height: 60px;margin-right: 5px;" :src="ossTransferThumbnail(pic,'one')"
                            fit="scale-down"
                            :preview-src-list="ossTransfer(scope.row.oss,'list')"
                  ></el-image>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="交接信息" name="3" v-if="handoverOptions && handoverOptions.length > 0">
            <handover-order :form="form" :handoverOptions="handoverOptions"
                            v-if="handoverOptions && handoverOptions.length > 0"
            ></handover-order>
          </el-tab-pane>
          <el-tab-pane label="交接原件" name="4" v-if="handoverOssList && handoverOssList.length > 0">
            <el-card shadow="never">
              <div slot="header">
                <image-upload v-model="handoverOssList"/>
                <el-button style="position: absolute;right: 10px;top: 0;" type="text" @click="handoverUpload">重新上传
                </el-button>
              </div>
              <el-image v-for="(pic,pindex) in handoverOssList"
                        style="width: 100%;" :src="ossTransfer(pic,'list')" fit="scale-down"
                        :preview-src-list="ossTransfer(handoverOssList,'list')"
              ></el-image>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="配送信息" name="5" v-if="orderOptions">
            <el-tabs tab-position="left">
              <el-tab-pane label="订单信息">
                <el-descriptions title="基本信息" :column="3" border>
                  <el-descriptions-item label="订单编号">{{ orderOptions.orderNo }}</el-descriptions-item>
                  <el-descriptions-item label="所属部门">{{ orderOptions.deptName }}</el-descriptions-item>
                  <el-descriptions-item label="物品数量">{{ orderOptions.nums }}</el-descriptions-item>
                  <el-descriptions-item label="客户名称" v-if="orderOptions.clientName">{{ orderOptions.clientName }}
                  </el-descriptions-item>
                  <el-descriptions-item label="联系人" v-if="orderOptions.clientContacts">
                    {{ orderOptions.clientContacts }}
                  </el-descriptions-item>
                  <el-descriptions-item label="联系电话" v-if="orderOptions.clientTel">{{ orderOptions.clientTel }}
                  </el-descriptions-item>
                  <el-descriptions-item label="备注" :span="3">{{ orderOptions.memo }}</el-descriptions-item>
                </el-descriptions>
                <el-descriptions title="寄收地址" :column="3" border style="margin-top: 15px;">
                  <el-descriptions-item label="寄件单位">{{ orderOptions.sendAddr }}</el-descriptions-item>
                  <el-descriptions-item label="寄件联系人">{{ orderOptions.sendContacts }}</el-descriptions-item>
                  <el-descriptions-item label="联系方式">{{ orderOptions.sendTel }}</el-descriptions-item>
                  <el-descriptions-item label="寄件地址" :span="3">{{ orderOptions.sendAddress }}</el-descriptions-item>
                  <el-descriptions-item label="收件单位">{{ orderOptions.takeAddr }}</el-descriptions-item>
                  <el-descriptions-item label="收件联系人">{{ orderOptions.takeContacts }}</el-descriptions-item>
                  <el-descriptions-item label="联系方式">{{ orderOptions.takeTel }}</el-descriptions-item>
                  <el-descriptions-item label="收件地址" :span="3">{{ orderOptions.takeAddress }}</el-descriptions-item>
                </el-descriptions>
                <el-card style="margin-top: 15px;">
                  <div slot="header" class="clearfix">
                    <span style="font-weight: bold;">物品清单</span>
                  </div>
                  <el-table :data="orderOptions.items">
                    <el-table-column label="编号" prop="pno"/>
                    <el-table-column label="名称" prop="name"/>
                    <el-table-column label="数量" prop="nums"/>
                  </el-table>
                </el-card>
                <el-card v-if="form.buss == '1'">
                  <div slot="header" class="clearfix">
                    <span>车辆附件</span>
                  </div>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>全车外观</span>
                    </div>
                    <el-image v-if="orderOptions.facadeOss && orderOptions.facadeOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.facadeOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.facadeOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>车架号</span>
                    </div>
                    <el-image v-if="orderOptions.carOss && orderOptions.carOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.carOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.carOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>交接现场</span>
                    </div>
                    <el-image v-if="orderOptions.handoverOss && orderOptions.handoverOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.handoverOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.handoverOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%"
                           v-if="orderOptions.loadOss && orderOptions.loadOss.length > 0"
                  >
                    <div slot="header" class="clearfix">
                      <span>45度装车</span>
                    </div>
                    <el-image v-if="orderOptions.loadOss && orderOptions.loadOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.loadOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.loadOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>外观瑕疵</span>
                    </div>
                    <el-image v-if="orderOptions.flawOss && orderOptions.flawOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.flawOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.flawOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>到达目的地</span>
                    </div>
                    <el-image v-if="orderOptions.takeOss && orderOptions.takeOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.takeOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.takeOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>卸车</span>
                    </div>
                    <el-image v-if="orderOptions.unloadOss && orderOptions.unloadOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.unloadOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.unloadOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>其他</span>
                    </div>
                    <el-image v-if="orderOptions.otherOss && orderOptions.otherOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.otherOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.otherOss,'list')"
                    ></el-image>
                  </el-card>
                  <el-card class="fl mr10 mb10" style="width: 32%">
                    <div slot="header" class="clearfix">
                      <span>其他</span>
                    </div>
                    <el-image v-if="orderOptions.otherTwoOss && orderOptions.otherTwoOss.length > 0"
                              v-for="(pic,pindex) in orderOptions.otherTwoOss"
                              style="width: 120px; height: 60px;margin-right: 5px;"
                              :src="ossTransferThumbnail(pic,'one')" fit="scale-down"
                              :preview-src-list="ossTransfer(orderOptions.otherTwoOss,'list')"
                    ></el-image>
                  </el-card>
                </el-card>
              </el-tab-pane>
              <el-tab-pane label="运单信息" v-if="orderOptions.wayItems && orderOptions.wayItems.length > 0">
                <template v-for="item in orderOptions.wayItems">
                  <el-steps :active="item.status == 2?0:(item.status == 3?1:(item.status == 5?2:3))" align-center
                            process-status="finish" finish-status="success" simple style="margin-bottom: 10px;"
                  >
                    <el-step title="发车"></el-step>
                    <el-step title="到达"></el-step>
                    <el-step title="签收"></el-step>
                    <el-step title="完成"></el-step>
                  </el-steps>
                  <el-tabs v-model="wayName">
                    <el-tab-pane label="基本信息" name="1">
                      <el-descriptions :column="3" border>
                        <el-descriptions-item label="运单编号">{{ item.waybillNo }}</el-descriptions-item>
                        <el-descriptions-item label="线路">{{ item.lineName }}</el-descriptions-item>
                        <el-descriptions-item label="车次">{{ item.scheduleName }}</el-descriptions-item>
                        <el-descriptions-item label="车牌号">{{ item.carNumber }}</el-descriptions-item>
                        <el-descriptions-item label="司机" :span="2">{{ item.driverName }}</el-descriptions-item>
                        <el-descriptions-item label="物品数量">{{ item.nums }}</el-descriptions-item>
                      </el-descriptions>
                    </el-tab-pane>
                    <el-tab-pane label="物品清单" name="2">
                      <el-card>
                        <el-table :data="item.items">
                          <el-table-column label="编号" prop="pno"/>
                          <el-table-column label="名称" prop="name"/>
                          <el-table-column label="数量" prop="nums"/>
                        </el-table>
                      </el-card>

                    </el-tab-pane>
                    <el-tab-pane label="日志跟踪" name="3">
                      <el-card>
                        <el-table :data="item.logItems">
                          <el-table-column label="操作人" prop="operator"/>
                          <el-table-column label="节点名称">
                            <template slot-scope="scope">
                              <dict-tag :options="dict.type.tms_track_log_type" :value="scope.row.type"/>
                            </template>
                          </el-table-column>
                          <el-table-column label="操作时间" prop="createTime"></el-table-column>
                          <el-table-column label="备注" prop="memeo"/>
                        </el-table>
                      </el-card>
                    </el-tab-pane>
                  </el-tabs>
                </template>
              </el-tab-pane>
            </el-tabs>
          </el-tab-pane>
          <el-tab-pane label="挑拣任务" name="6" v-if="putTaskOptions && putTaskOptions.length > 0">
            <template v-for="item in putTaskOptions">
              <el-card style="margin-bottom: 15px;">
                <el-descriptions :column="3" border>
                  <el-descriptions-item label="任务编号">{{ item.pickNo }}</el-descriptions-item>
                  <el-descriptions-item label="挑拣员">{{ item.nickName }}</el-descriptions-item>
                  <el-descriptions-item label="状态">
                    <dict-tag :options="dict.type.wms_pick_task_status" :value="item.status"/>
                  </el-descriptions-item>
                </el-descriptions>
                <el-card style="margin-top: 15px;" shadow="never">
                  <div slot="header" class="clearfix">
                    <span>物品清单</span>
                  </div>
                  <el-table :data="item.items">
                    <el-table-column label="编号" prop="pno"/>
                    <el-table-column label="名称" prop="name"/>
                    <el-table-column label="数量" prop="nums"/>
                    <el-table-column label="状态" prop="nums">
                      <template slot-scope="scope">
                        <dict-tag :options="dict.type.wms_pick_task_status" :value="scope.row.status"/>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-card>
              </el-card>
            </template>
          </el-tab-pane>
          <el-tab-pane label="视频记录" name="7">
            <el-card class="box-card" shadow="hover">
              <dh-video :task-id="form.id"/>
            </el-card>
          </el-tab-pane>
          <el-tab-pane label="操作日志" name="8">
            <el-table :data="logOptions" border stripe>
              <el-table-column label="序号" type="index" width="50" align="center"/>
              <el-table-column label="操作时间" align="left" prop="logTime" width="180"/>
              <el-table-column label="操作人" align="left" prop="operator" width="200"/>
              <el-table-column label="操作内容" align="left" prop="content"/>
            </el-table>
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </el-drawer>
  </div>
</template>
<script>
import { storeTreeselect, listStore } from '@/api/wms/store'
import { treeselect } from '@/api/system/dept'
import {
  listTask,
  getTask,
  getStatisticsTask,
  restoreTask,
  removeTask,
  reviewOss,
  removeTaskByAdmin
} from '@/api/oms/task'
import { sendsTask, getCarrierUser } from '@/api/center/index'
import { listHandover, listHandoverInfo } from '@/api/wms/handover'
import { listOss } from '@/api/system/oss'
import { getOrderTask } from '@/api/tms/order'
import { getPutTaskByTask } from '@/api/wms/putTask'
import { listOperatorLog } from '@/api/oms/operatorLog'
import { listCarrier } from '@/api/tms/carrier'
import { listCar } from '@/api/tms/car'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { htmlToPdf, htmlToPdfInfo } from '@/utils/pdf.js'
import { delHandoverDtl } from '@/api/wms/handoverDtl'
import DhVideo from '@/components/dhVideo'

export default {
  dicts: ['deal_type', 'tms_track_log_type', 'oms_delivery_type', 'oms_task_type', 'oms_task_source', 'oms_task_status', 'oms_property_type', 'handover_dtl_status', 'oms_send_status', 'wms_put_task_status', 'oms_out_delivery_type', 'oms_in_delivery_type', 'oms_task_card_type', 'sys_common_status'],
  components: { DhVideo, Treeselect },
  data() {
    return {
      /**
       * 左侧筛选
       */
      storeName: undefined,
      storeOptions: [],
      defaultProps: {
        children: 'children',
        label: 'label'
      },

      statisticsOptions: [],

      sendStatusVal: 0,

      /**
       * 右侧数据
       */
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 显示承运商搜索
      show: false,
      showAll: false,
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 总条数
      total: 0,
      taskList: [],
      // 默认排序
      defaultSort: { prop: 'createTime', order: 'descending' },
      // 查询参数
      deptOptions: [],
      daterangeCreateTime: [],
      daterangeHandleTime: [],
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        type: undefined,
        storeId: undefined,
        deptId: undefined,
        taskNo: undefined,
        delivery: undefined,
        status: undefined,
        orderTime: undefined,
        delFlag: '0',
        carrierDeptId: undefined,
        proKey: undefined,
        outstatus: undefined,
        instatus: undefined,
        dealType: undefined,
        xzType: undefined,
        params: {
          beginCreateTime: undefined,
          endCreateTime: undefined
        }
      },
      //详情
      form: {},
      returnForm: {},
      open: false,
      title: undefined,
      activeName: '1',
      wayName: '1',
      //详情-交接
      handoverOptions: [],
      //详情-订单
      orderOptions: {},
      //详情-上架
      putTaskOptions: {},
      //详情-日志
      logOptions: [],
      //承运商筛选
      carrierOptions: [],
      //车辆筛选
      carOptions: [],
      //派遣人筛选
      userOptions: [],
      handoverOssList: [],
      orderTypes: [
        { 'label': '入库订单', 'value': '0' },
        { 'label': '出库订单', 'value': '1' },
        { 'label': '处置订单', 'value': '2' },
        { 'label': '调用订单', 'value': '3' },
        { 'label': '归还订单', 'value': '5' }
      ],
      inStatuses: [
        { 'label': '订单已审核/下发', 'value': '1' },
        { 'label': '取件交接', 'value': '2' },
        { 'label': '管理中心签收', 'value': '3' },
        { 'label': '管理中心上架', 'value': '4' }
      ],
      outStatuses: [
        { 'label': '订单已审核/下发', 'value': '1' },
        { 'label': '已挑拣', 'value': '2' },
        { 'label': '已签收', 'value': '3' }
      ],
      dealTypes: [
        { 'label': '拍卖', 'value': '5' },
        { 'label': '返还当事人', 'value': '3' },
        { 'label': '销毁', 'value': '6' }
      ],
      carrierName: undefined,
      sendTaskForm: {
        carrierDeptId: undefined,
        storeId: undefined,
        carId: undefined,
        pickupId: undefined
      },
      rules: {
        carrierDeptId: [{
          required: true,
          message: '承运商不能为空',
          trigger: 'change'
        }],
        storeId: [{
          required: true,
          message: '存放位置不能为空',
          trigger: 'change'
        }]
      },
      buttonLoading: false,
      tabs: [
        { label: '0', name: '全部', badge: undefined, sendStatus: undefined, delFlag: '0', delivery: undefined },
        { label: '1', name: '待下发', badge: undefined, sendStatus: '0', delFlag: '0', delivery: '0' },
        { label: '2', name: '已下发', badge: undefined, sendStatus: '1', delFlag: '0', delivery: '0' },
        { label: '3', name: '自行配送', badge: undefined, sendStatus: undefined, delFlag: '0', delivery: '1' },
        { label: '4', name: '已撤销', badge: undefined, sendStatus: undefined, delFlag: '2', delivery: undefined }
      ],
      xzTabVal: 0,
      xzTabs: [
        { label: '0', name: '刑事类', badge: undefined, xzType: 'xs', delFlag: '0', delivery: undefined },
        { label: '1', name: '行政类', badge: undefined, xzType: 'xz', delFlag: '0', delivery: '0' }
      ],
      isFour: false
    }
  },
  activated() {
    const time = this.$route.query.t
    if (time != null && time != this.uniqueId) {
      this.uniqueId = time
      this.queryParams.pageNum = Number(this.$route.query.pageNum)
      this.getList()
    }
  },
  created() {
    // this.queryParams.type = this.$router.currentRoute.query.type ? this.$router.currentRoute.query.type:'0'
    this.getStoreTreeselect()
    this.getList()
    // this.getTreeselect();
    this.getStatistics()
    // this.getUser();
  },
  methods: {
    /** 查询出入库订单列表 */
    getList() {
      this.loading = true
      if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
        this.queryParams.params['beginCreateTime'] = this.daterangeCreateTime[0]
        this.queryParams.params['endCreateTime'] = this.daterangeCreateTime[1]
      } else {
        this.queryParams.params['beginCreateTime'] = undefined
        this.queryParams.params['endCreateTime'] = undefined
      }
      if (null != this.daterangeHandleTime && '' != this.daterangeHandleTime) {
        this.queryParams.params['beginHandleTime'] = this.daterangeHandleTime[0]
        this.queryParams.params['endHandleTime'] = this.daterangeHandleTime[1]
      } else {
        this.queryParams.params['beginHandleTime'] = undefined
        this.queryParams.params['endHandleTime'] = undefined
      }
      this.queryParams.xzType = this.xzTabVal
      listTask(this.queryParams).then(response => {
        this.taskList = response.rows
        this.total = response.total
        this.loading = false

        this.tabs.forEach((item) => {
          if (item.label == this.sendStatusVal) {
            item.badge = this.total
          } else {
            item.badge = undefined
          }
        })
      })
    },
    /** 排序触发事件 */
    handleSortChange(column, prop, order) {
      this.queryParams.orderByColumn = column.prop
      this.queryParams.isAsc = column.order
      this.getList()
    },
    orderTypeChange(e) {
      console.info('orderTypeChange==========>', e)
      this.queryParams.instatus = undefined
      this.queryParams.outstatus = undefined
      this.queryParams.dealType = undefined
    },
    radioChange(e) {
      console.info('e==========>', e)
      this.tabs.forEach(item => {
        if (item.label == e) {
          this.queryParams.sendStatus = item.sendStatus
          this.queryParams.delFlag = item.delFlag
          this.queryParams.delivery = item.delivery
        }
      })
      this.getList()
    },
    xzTabChange(e) {
      this.getList()
    },
    getStatistics() {
      getStatisticsTask({ delivery: this.queryParams.delivery, delFlag: '0' }).then(response => {
        this.statisticsOptions = response.data.result
      })
    },
    statisticsChange(item) {
      this.queryParams.region = item.region
      this.getList()
    },

    getShowFour(length, item) {
      if (length == 1 && item.htype == '0') {
        this.isFour = true
        return 6
      } else {
        this.isFour = false
        return 8
      }

    },

    /**
     * 左侧操作
     */
    /** 查询分类下拉树结构 */
    getStoreTreeselect() {
      storeTreeselect().then(response => {
        this.storeOptions = response.data
      })
    },
    // 筛选节点
    filterNode(value, data) {
      if (!value) return true
      return data.label.indexOf(value) !== -1
    },
    // 节点单击事件
    handleNodeClick(data) {
      this.queryParams.storeId = data.id
      this.form.storeId = data.id
      this.handleQuery()
    },
    /**
     * 右侧数据
     */
    /** 查询部门下拉树结构 */
    getTreeselect() {
      treeselect().then(response => {
        this.deptOptions = response.data
      })
    },
    /** 查询订单信息 */
    getOrderInfo(id) {
      getOrderTask(id).then(response => {
        this.orderOptions = response.data
      })
    },
    /** 查询上架信息 */
    getPutTaskInfo(id) {
      getPutTaskByTask(id).then(response => {
        this.putTaskOptions = response.data
      })
    },
    /** 查询交接信息 */
    getHandover(id) {
      listHandoverInfo({ 'objid': id }).then(response => {
        this.handoverOptions = response.data
      })
    },
    /** 查询日志 */
    getLogs(id) {
      listOperatorLog({ 'objid': id }).then(response => {
        let logOptions = []
        if (response.rows && response.rows.length > 0) {
          response.rows.forEach(item => {
            if (item.logType == 'tms' && item.content == '签收') {

            } else {
              logOptions.push(item)
            }
          })
        }
        this.logOptions = logOptions
      })
    },
    /** 查询车辆 */
    getCar(carrierDeptId) {
      listCar({ carrierDeptId: carrierDeptId }).then(response => {
        // if(response.rows.length == 0 && this.carrierName.indexOf('车辆') == -1){
        //   this.$modal.notifyWarning("当前承运商暂无车辆信息，请联系该承运商！");
        // }
        this.carOptions = response.rows
      })
    },
    getUser() {
      getCarrierUser().then(response => {
        this.userOptions = response.data
      })
    },
    getHandoverOss(objid) {
      listOss({ 'objid': objid, 'buss': 'handoverDtl' }).then(response => {
        console.info('getHandoverOss======>', response)
        this.handoverOssList = response.rows
      })
    },
    /**
     * 重新上传
     */
    handoverUpload() {
      reviewOss({ id: this.form.id, oss: this.handoverOssList }).then(response => {
        if (response.code == 200) {
          this.getHandoverOss(this.form.id)
        }
      })
    },

    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      // if(this.queryParams.orderTime){
      //   this.queryParams.params.beginCreateTime = this.queryParams.orderTime+'00:00:00'
      //   this.queryParams.params.endCreateTime = this.queryParams.orderTime+'23:59:59'
      // }
      this.getList()
      this.getStatistics()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeCreateTime = []
      this.daterangeHandleTime = []
      this.resetForm('queryForm')
      // this.queryParams.orderTime = undefined;
      this.queryParams.params.beginCreateTime = undefined
      this.queryParams.params.endCreateTime = undefined
      this.queryParams.params.beginHandleTime = undefined
      this.queryParams.params.endHandleTime = undefined
      this.queryParams.region = undefined
      this.handleQuery()
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },

    //查看详情
    handleInfo(row) {
      getTask(row.id).then(response => {
        this.form = response.data
        if (response.data.info) {
          this.returnForm = JSON.parse(response.data.info)
        }
        this.open = true
        this.title = '申请单详情'
        this.activeName = '1'
        //交接明细
        this.getHandover(row.id)
        this.getOrderInfo(row.id)
        this.getPutTaskInfo(row.id)
        this.getLogs(row.id)
        this.getHandoverOss(row.id)
      })
    },
    //恢复
    handleRestore(row) {
      this.$modal.confirm('是否确认恢复当前订单?').then(() => {
        this.loading = true
        return restoreTask(row.id)
      }).then(() => {
        this.loading = false
        this.$modal.msgSuccess('恢复成功')
      }).finally(() => {
        this.getList()
        this.loading = false
      })
    },

    //详情关闭
    close() {
      this.open = false
    },
    //关闭
    handleClose() {
      this.show = false
      this.buttonLoading = false
    },
    handleCloseAll() {
      this.showAll = false
      this.buttonLoading = false
    },
    handleSendAll() {
      this.sendTaskForm = {}
      listCarrier().then(response => {
        this.carrierOptions = response.rows
        this.showAll = true
        this.carOptions = []
      })
    },
    handleSend(row) {
      this.sendTaskForm = {}
      this.sendTaskForm.id = row.id
      this.sendTaskForm.storeId = row.storeId
      listCarrier().then(response => {
        this.carrierOptions = response.rows
        this.show = true
        this.carOptions = []
      })
    },
    loadCarrier() {
      listCarrier().then(response => {
        this.carrierOptions = response.rows
      })
    },
    deliverChage(e) {
      this.queryParams.carrierDeptId = undefined
      if (e == 0) {
        this.loadCarrier()
      }
    },
    /**
     * 打印交接单
     * @param {Object} title
     */
    handlePrint(title) {
      // const printOrder = this.$refs['printOrder'];
      htmlToPdf('#printOrder', title)
    },
    handlePrintInfo(title) {
      htmlToPdfInfo('#printOrder')
    },
    handlePrintPre(title) {
      // const printOrder = this.$refs['printOrder'];
      htmlToPdf('#printOrderPre', title)
    },
    /** 删除按钮操作 */
    handleDeleteHandoverDtl(id) {
      const ids = id
      this.$modal.confirm('是否确认删除交接信息明细编号为"' + ids + '"的数据项？').then(() => {
        this.loading = true
        return delHandoverDtl(ids)
      }).then(() => {
        this.loading = false
        this.$modal.msgSuccess('删除成功')
      }).finally(() => {
        this.loading = false
      })
    },
    handleDel({ id, taskNo }) {
      this.$prompt('请输入撤销原因', `撤销订单${taskNo}`).then(({ value }) => {
        if (value) {
          this.loading = true
          let data = { cancelReason: value }
          removeTask(id, data).then(() => {
            this.$modal.msgSuccess('撤销成功')
          }).finally(() => {
            this.getList()
            this.loading = false
          })
        } else {
          this.$message.error('请输入原因')
        }
      })
    },
    handleAdminDel({ id, taskNo }) {
      this.$prompt('请输入强制撤销原因', `强制撤销订单${taskNo}`).then(({ value }) => {
        if (value) {
          this.loading = true
          let data = { cancelReason: value }
          removeTaskByAdmin(id, data).then(() => {
            this.$modal.msgSuccess('撤销成功')
          }).finally(() => {
            this.getList()
            this.loading = false
          })
        } else {
          this.$message.error('请输入原因')
        }
      })
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('oms/task/exportTaskDtl', {
        ...this.queryParams
      }, `订单导出_${new Date().getTime()}.xlsx`)
    }
  }
}
</script>
<style>
#handoverCard.box-card .el-card__header {
  border-bottom-color: #000;
}

/**
改变边框颜色
 */
#handoverCard.box-card .el-table {
  border-bottom: 1px solid #000;
  border-right: 1px solid #000;
  margin: 0 auto;
}

#handoverCard.box-card .el-table th {
  border: 1px solid black !important;
  border-right: none !important;
  border-bottom: none !important;
}

#handoverCard.box-card .el-table td {
  border: 1px solid black;
  border-right: none !important;
}

.el-badge__content.is-fixed {
  z-index: 1;
}
</style>
